package deepbrain.simnetwork.structure;

import java.text.NumberFormat;
import java.text.ParseException;

import deepbrain.simnetwork.exception.SimNetworkException;

/**
 *
 *
 * @author Li Yang
 * @create 2009-2-23
 */
public class NumberMatrix extends Matrix<Number> {

	private static final long serialVersionUID = 4903583532804769687L;

	@Override
	public String getMatrixType() {
		return "Connection Matrix";
	}

	public NumberMatrix() {
		super();
	}

	public NumberMatrix(Number[][] matrix) throws SimNetworkException {
		super(matrix);
	}

	@Override
	public Number parseWeight(String weight)
			throws SimNetworkException {
		Number number;
		try {
			number = NumberFormat.getInstance().parse(weight);
		} catch (ParseException e) {
			throw new SimNetworkException(e);
		}
		return number;
	}

}
